# coding: utf-8
from django.db import transaction
from django.http import HttpResponseRedirect, JsonResponse

from common.models.fun import Bottle, BottleGetTrace
import re


class UtilService(object):
    @classmethod
    def valid_regex(cls, type, str):
        if type == 'URL':   # 验证是否是URL
            _reg_ex = r'^(https?|ftp)://[a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+$'
            t = re.search(_reg_ex, str)

            return True if t else False


    @classmethod
    def send_simple_mail(cls):
        pass